import request from '../request'

interface ChatMessage {
    topic: 'chat' | 'sqlSearch' | 'sqlUpdate'
    question: string
    userId?: string
}

export const send = async (params: ChatMessage) => {
    try {
        const res = await request.post('/ai/unified', params)
        return res.data
    } catch (err) {
        throw err
    }
}
